package com.itheima.controller;

import com.github.pagehelper.PageInfo;
import com.itheima.pojo.OperateLog;
import com.itheima.pojo.PageResult;
import com.itheima.pojo.Result;
import com.itheima.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: zhengsuyang
 * @Desc:
 * @create: 2025-09-14 17:24
 **/
@RestController
public class LogController {
    @Autowired
    private LogService logService;
    @GetMapping("/log/page")
    public Result getLogPage(@RequestParam(defaultValue ="1",name = "page") int page,
                             @RequestParam(defaultValue ="10",name = "pageSize") int pageSize){
        PageResult<OperateLog> pageResult = logService.getLogPage(page,pageSize);
        return Result.success(pageResult);

    }
}
